<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        async function getData(){
            const await1 = await new Promise((resolve,reject)=>{
                resolve("成功")
            });
            // console.log("await1",await1);

            // const await2 = await new Promise((resolve,reject)=>{
            //     reject("失败")
            // });
            
            
            // a.b()
            // return 1
            return await new Promise((resolve,reject)=>{
                reject("失败")
            });
        }

        const result = getData()
        console.log("result",result);
        // console.log("await2",await2);

    </script>
</body>
</html>